Fix recipe loading when fmf tree is not present#4807
Conversation
7f66223 to
ac92ce2
Compare
There was a problem hiding this comment.
Code Review
This pull request transitions the recipe system to use absolute paths for results and refactors the RecipeManager to handle fmf tree creation internally. It also adds custom serialization for ReportPortal report data to ensure correct formatting of log limits and patterns. A suggestion was made to remove a redundant tree check in tmt/base/core.py to support recipe loading in standalone environments where a tree might not yet exist.
|
I tried to verify the fix by doing a basic tmt run via container. Then I moved into a blank directory with no fmf tree and tried to run with the recipe file: (PR) Looks like it made the fake tree, but the tree does not have the supporting test files. Am I reproducing this correctly? |
Yes, I would say that is expected. When users move the recipe or execute it from a different location, they should handle the necessary test files. Either move them to the new directory or rewrite the recipe with updated paths. |
|
I think I am misunderstanding the use case. What situations would a user execute the tmt command outside of the fmf tree? Could you provide an example or add a test case, please? |
In some cases, an fmf tree is not needed when the run is loaded from the recipe, unless the test requires some additional files. I ran into this while creating a script for re-executing tests. tmt would raise an exception due to a missing tree, even though we wouldn't need it. But looking at it again, I completely missed that we actually save the fmf root path in the recipe, so we can just set it from there, and that would solve the issue. Changed in f2512fc. |
👍 to the idea, but can you double check that the tree in there is the user tree and not the work tree. If it is the latter, then it should be changed to the former imo.
Not exactly the original context, but a situation that should probably be supported (or disallowed explicitly) is if one runs |
It is a user tree, e.g. |
LecrisUT
left a comment
There was a problem hiding this comment.
👍 from me, but I deffer to @tcornell-bus discussion on handling the case with no fmf trees
tcornell-bus
left a comment
There was a problem hiding this comment.
LGTM now.
In an empty tmp dir with no fmf tree:
Old:
tcornell ~/tmp $ tmt run -vvv --recipe /var/tmp/tmt/run-063/recipe.yaml
No metadata found in the '.' directory. Use 'tmt init' to get started.
The exception was caused by 1 earlier exceptions
Cause number 1:
Unable to find tree root for '/home/tcornell/tmp'.
PR:
(dev) tcornell ~/tmp $ tmt run -vvv --recipe /var/tmp/tmt/run-063/recipe.yaml
/var/tmp/tmt/run-095
[...]
Found 1 plan.
/plans/all
summary: Run all tests
discover
directory: /home/tcornell/tmt_testing
how: fmf
order: 50
summary: 1 test selected
/smoke
[....]
total: 1 test passed
It found the original fmf tree and successfully executed.
4d08082 to
e43419c
Compare
|
freedesktop.org is down, hence the linkcheck fail. The rest is green, merging. |
Recipe loading now works even when the current working directory does not contain an fmf tree, by creating a new tree from the saved fmf root path.
Pull Request Checklist